#include <stdio.h>

int main( )
{
    int a, b, t;
    scanf("%d", &t);
    while ( t-- )
    {
        scanf("%d%d", &a, &b);
        a %= 100;
        b %= 100;
        printf("%d\n", ( a + b ) % 100 );
    }
    return 0;
}
